package com.hsq.file_;

import java.util.Date;
import java.util.Scanner;

public class TestScanner {
    public static void main(String[] args) {
        String strDate = null;
        Date date = null;
        String str = null;
        Scanner scan = new Scanner(System.in);
//        scan.useDelimiter("\n");
        System.out.println("Please input date: ");
//        str = scan.next();
        str = scan.nextLine();
        System.out.println("str = " + str);
        System.out.println("请输入小数：");
        if (scan.hasNextFloat()){
            //判断是否是小数
            System.out.println("小数数据 = " + scan.nextFloat());
        }
        else {
            System.out.println("输入的不是小数");
        }
    }
}
